﻿// **********************************************************************
//
// Author: KingSley
// Email:3268374537@qq.com
// Created:	2018/8/1   11:10
// Introduce: 对场景加载进行管理
//
// **********************************************************************
using UnityEngine;
using UnityEngine.SceneManagement;

namespace KingSley
{
    public class SceneController : MonoSingleton<SceneController>
    {
        /// <summary>
        /// 经过加载场景实现场景的跳转
        /// </summary>
        /// <param name="lastName">目标场景</param>
        /// <param name="loadingName">加载场景</param>
        public void LoadSceneWithLoading(string lastName,string loadingName)
        {
            GlobelScene.SceneName = lastName;
            SceneManager.LoadScene(loadingName);
        }

        /// <summary>
        /// 直接跳转场景
        /// </summary>
        /// <param name="lastName">目标场景</param>
        public void LoadSceneRightNow(string lastName)
        {
            Debug.Log("跳转场景：" + lastName);
            SceneManager.LoadScene(lastName);
        }
    }
}